{__NOLAYOUT__}

<form data-method="post" data-action="{:url('admin/article/saveData')}" data-submit="ajax" data-validate="true" class="form-horizontal">
    <div class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span></button>
                    <h3 class="modal-title">{$data['id']?lang('Edit'):lang('Add')}{:lang('Article')}</h3>
                </div>
                <input type="hidden" name="id" value="{$data.id ?? ''}">
                <div class="modal-body">
                    <div class="modal-body-content">
                        <div class="form-group must">
                            <label class="col-sm-3 control-label">{:lang('ArticleCategory')}</label>
                            <div class="col-sm-7">
                                <select name="cid" id="" class="form-control" required>
                                    {volist name="roleData" key="key" id="vo"}
                                    <option value="{$key-1}">{$vo}</option>
                                    {/volist}
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">{:lang('ArticleTitle')}</label>
                            <div class="col-sm-7"> 
                                <input type="text" class="form-control" name="title" maxlength="11" placeholder="{:lang('Up_characters',['langth' =>25])}" required value="{$data.title ?? ''}"  >
                            </div>
                        </div>


                        <div class="form-group">
                            <label class="col-sm-3 control-label">{:lang('SeoTitle')}</label>
                            <div class="col-sm-7">
                                <input type="text" class="form-control equalto" name="seo_title" rangelength="[6,16]" placeholder="{:lang('Range_characters',['minLangth' =>6,'maxLangth' => 16])}" required value="{$data.seo_title ?? ''}">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">{:lang('SeoKeys')}</label>
                            <div class="col-sm-7">
                                <input type="text" class="form-control equalto" name="seo_keys" rangelength="[6,16]" placeholder="{:lang('Range_characters',['minLangth' =>6,'maxLangth' => 16])}" required value="{$data.seo_keys ?? ''}">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">{:lang('SeoDesc')}</label>
                            <div class="col-sm-7">
                                <input type="text" class="form-control equalto" name="seo_desc" rangelength="[6,16]" placeholder="{:lang('Range_characters',['minLangth' =>6,'maxLangth' => 16])}" required value="{$data.seo_desc ?? ''}">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">{:lang('ArticleContent')}</label>
                            <div class="col-sm-7">

                                <textarea   id="ArticleContent"  name="content"  >{$data.content ?? ''}</textarea>
                                <script type="text/javascript">
                                    UE.delEditor("ArticleContent");//可能是缓存问题导致的，因此先删除缓存中已有的富文本，
                                    var ue = UE.getEditor('ArticleContent',{
                                        toolbars: [
                                            ['fullscreen', 'source', 'undo', 'redo','simpleupload'],
                                            ['bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc']
                                        ]
                                    });

                                </script>
                                    <!--<script type="text/javascript">-->
                                        <!--CKEDITOR.replace( 'ArticleContent' ,{ //这里的 mycontent就是上面我们设置的textarea或者input元素的id-->
<!--//                                                filebrowserBrowseUrl:'__CK__/ckfinder.html',//设置上传图片的页面为ckfinder.html-->
<!--//                                                filebrowserImageBrowseUrl:'__CK__/ckfinder.html?type=Images',-->
<!--//                                                filebrowserFlashBrowseUrl: '__CK__/ckfinder.html?type=Flash',-->
                                                <!--filebrowserUploadUrl: '__CK__/core/connector/php/connector.php?command=QuickUpload&type=Files',-->
                                                <!--filebrowserImageUploadUrl: '__CK__/core/connector/php/connector.php?command=QuickUpload&type=Images',-->
                                                <!--filebrowserFlashUploadUrl: '__CK__/core/connector/php/connector.php?command=QuickUpload&type=Flash',-->
<!--//                                                width:530,//设置默认宽度为900px-->
<!--//                                                height:300  //设置默认高度是300px，这个高度是不包含顶部菜单的高度-->
                                            <!--}-->
                                        <!--);-->
                                <!--</script>-->

                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">{:lang('author')}</label>
                            <div class="col-sm-7">
                                <input  class="form-control equalto" name="author" rangelength="[6,16]" placeholder="{:lang('Range_characters',['minLangth' =>6,'maxLangth' => 16])}" required required value="{$data.author ?? ''}">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">{:lang('Status')}</label>
                            <div class="col-sm-7">
                                <select name="status" class="form-control" required>
                                    <option value="1" {$data['status']==1 ? 'selected' : ''}>{:lang('Start')}</option>
                                    <option value="2" {$data['status']==2 ? 'selected' : ''}>{:lang('Hide')}</option>
                                    <option value="0" {$data['status']==0 ? 'selected' : ''}>{:lang('Off')}</option>
                                </select>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">{:lang('Cancel')}</button>
                    <button type="submit" class="btn btn-primary">{:lang('Save')}</button>
                </div>
            </div>
        </div>
    </div>
</form>